/**
 * Created by zoushuiyun on 2017/5/31.
 */
import {RouterModule, Routes} from "@angular/router";
import {LocationStrategy, HashLocationStrategy} from "@angular/common";
import {NgModule} from "@angular/core";
import {DemoComponent} from "../modules/demo/demo.component";

const routes: Routes = [
  {path: '', redirectTo: 'demo', pathMatch: 'full'},
  {path: 'demo',component: DemoComponent},
];

@NgModule({
  imports:[
    RouterModule.forRoot(routes),
    RouterModule.forChild([])
  ],
  exports:[RouterModule],
  providers:[
    {
      provide:LocationStrategy,// 导航路径的策略设置
      useClass: HashLocationStrategy // 使用'#'方式的策略
    }
  ]
})

export class AppRoutingModule{

}
